#!/bin/bash
#
# Generate GADGET-XML from INDEX
#
for name in $(egrep -v '^#' index.txt)
do
    stl=${name}.stl
    xml=gadget-${name}.xml

    cat<<EOF>${xml}
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="ULSF-ALTAZ16 Gadget ${name}" url="http://ulsf-altaz16.googlecode.com/git/components/gadget-${name}.xml" description="ALTAZ16 Antenna Rotator" author="John Pritchard" author_email="kd2cos@gmail.com" width="500" height="500">
  </ModulePrefs>
  <Content preferred_height="500" preferred_width="500" />
  <Content type="url" href="http://ulsf-altaz16.googlecode.com/git/components/gadget-${name}.html" />
</Module>
EOF
    git add ${xml}
    ls -l ${xml}
done
